<!DOCTYPE html>
<html>
<head>
    <title>登录 - WeChatBot</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-----------------------------------------------------------------------
- Copyright (C) 2025, iwyxdxl
- Licensed under GNU GPL-3.0 or higher, see the LICENSE file for details.
-
- This file is part of WeChatBot.
- WeChatBot is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- WeChatBot is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with WeChatBot.  If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------------>
    <style>
        body {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            margin: 0;
            background-color: #f7f8fc;
            font-family: Arial, sans-serif;
            align-items: center;
            justify-content: center;
            padding: 20px;
            box-sizing: border-box;
        }
        .header {
            width: 100%;
            max-width: 400px;
            margin-bottom: 20px;
        }
        h1 {
            color: #2c3e50;
            font-size: 1.8em;
            text-align: center;
            margin: 0 0 10px 0;
        }
        .login-container {
            background: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            width: 100%;
            max-width: 400px;
            box-sizing: border-box;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .login-container:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        }
        .error {
            color: #f44336;
            padding: 10px;
            background: #ffe6e6;
            border-radius: 4px;
            margin-bottom: 15px;
            text-align: center;
            font-size: 0.9em;
        }
        input[type="password"] {
            width: 100%;
            padding: 12px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 16px;
        }
        input[type="password"]:focus {
            border-color: #4CAF50;
            box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
            outline: none;
        }
        .btn {
            background-color: #4caf50;
            color: white;
            padding: 12px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            transition: background-color 0.3s;
            width: 100%;
            margin-top: 10px;
            box-sizing: border-box;
        }
        .btn:hover {
            background-color: #45a049;
        }
        .legal-notice {
            margin-top: 30px;
            padding: 15px 20px;
            background-color: #f7f8fc;
            border-top: 1px solid #e0e0e0;
            text-align: center;
            font-size: 0.85em;
            color: #6c757d;
            line-height: 1.5;
            width: 100%;
            max-width: 600px;
            box-sizing: border-box;
        }
        .legal-notice .legal-toggle {
            cursor: pointer;
            color: #4caf50;
            font-weight: bold;
            margin-bottom: 10px;
            display: inline-block;
        }
        .legal-notice .legal-content {
            display: none;
            text-align: left;
            font-size: 0.95em;
        }
        .legal-notice .legal-content a {
            color: #4caf50;
            text-decoration: none;
        }
        .legal-notice .legal-content a:hover {
            text-decoration: underline;
        }

        @media (max-width: 480px) {
            h1 {
                font-size: 1.6em;
            }
            .login-container {
                padding: 20px;
            }
            input[type="password"] {
                padding: 10px;
                font-size: 15px;
            }
            .btn {
                padding: 10px 18px;
                font-size: 15px;
            }
            .legal-notice {
                font-size: 0.8em;
                padding: 10px 15px;
            }
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>WeChatBot 网页编辑器登录</h1>
    </div>

    <div class="login-container">
        {% if error %}
        <div class="error">{{ error }}</div>
        {% endif %}

        <form method="POST">
            <input type="password"
                   name="password"
                   placeholder="请输入访问密码"
                   required>
            <button type="submit" class="btn">立即登录</button>
        </form>
    </div>

    <div class="legal-notice">
        <div class="legal-toggle" id="toggleLegal">显示法律声明</div>
        <div class="legal-content" id="legalContent">
            <p>
                Modified based on the <strong>KouriChat</strong> project.<br>
                原项目版权: Copyright (C) 2025, umaru<br>
                修改版本版权: Copyright (C) 2025, iwyxdxl
            </p>
            <p>
                本软件是自由软件，您可以根据 <a href="https://www.gnu.org/licenses/gpl-3.0.zh-cn.html" target="_blank">
                GNU 通用公共许可证 第3版（或更高版本）</a> 的条款重新发布和修改本软件。
            </p>
            <p>
                本软件按“现状”提供，不提供任何明示或暗示的担保（包括适销性或特定用途适用性）。<br>
                如您未收到完整的许可证副本，请访问 <a href="https://www.gnu.org/licenses/gpl-3.0.zh-cn.html" target="_blank">
                GNU GPL 3.0 中文版</a> 获取。
            </p>
            <p>
                源代码获取：<br>
                原项目源代码：<a href="https://github.com/KouriChat/KouriChat" target="_blank">https://github.com/KouriChat/KouriChat</a><br>
                本项目源代码：<a href="https://github.com/iwyxdxl/WeChatBot_WXAUTO_SE" target="_blank">https://github.com/iwyxdxl/WeChatBot_WXAUTO_SE</a>
            </p>
            <p>
                本软件仅供学习和娱乐使用，请勿用于违法用途，否则产生的一切法律责任均与任何作者无关。
            </p>
        </div>
    </div>
    <script>
        document.getElementById('toggleLegal').addEventListener('click', function() {
            var content = document.getElementById('legalContent');
            if (content.style.display === 'none' || content.style.display === '') {
                content.style.display = 'block';
                this.textContent = '隐藏法律声明';
            } else {
                content.style.display = 'none';
                this.textContent = '显示法律声明';
            }
        });
    </script>
</body>
</html>